package com.huike.pmps.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huike.pmps.model.entity.Permission;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 〈权限Dao〉
 */
public interface PermissionDao  extends BaseMapper<Permission> {

    /**
     * 根据角色id查找权限列表
     * @param roleId 角色id
     * @return 权限列表
     */
    @Select("select p.* from es_role_permission rp,es_permission p where rp.permission_id = p.id and rp.role_id = #{roleId}")
    List<Permission> findByRoleId(Integer roleId);


}
